<header id="topbar">
  <div class="topbar-left">
      <ol class="breadcrumb">
          <li class="crumb-active">
              <a href="#op/metis_six_part/">超级六牌局参与</a>
          </li>
      </ol>
  </div>
  <div class="topbar-right">
      <div class="ml15 ib va-m" id="toggle_sidemenu_r">
          <a href="#" class="pl5"> <i class="fa fa-sign-in fs22 text-primary"></i>
          </a>
      </div>
  </div>
</header>

<section id="content" class="animated fadeIn">
  <div class="panel overflow" >
      <table class="table table-striped fs13" id="main-list">
          <thead>
              <tr class="bg-light">
                  <th>ID</th>
                  <th>局号</th>
                  <th>用户ID</th>
                  <th>押注对象</th>
                  <th>押注金额</th>
                  <th>返还金额</th>
                  <th class="sortable" data-field="create_time">开始时间</th>
              </tr>
          </thead>
          <tbody class="admin-form">
              <% var moment = require('moment'); %>
              <%
              var buyAmount = 0;
              var winAmount = 0;
              _.each(items, function(item){
                  buyAmount += parseFloat(item.bet_amount);
                  winAmount += parseFloat(item.bet_result);
              %>
                  <tr data-id="<%= item.id %>">
                      <td><%= item.id %></td>
                      <td><%= item.round_id %></td>
                      <td><a href="#stats/account/?id=<%= item.user_id %>"><%= item.user_id %></a></td>
                      <td><%= METIS_SIX_INDEX[item.bet_index] %></td>
                      <td><%= item.bet_amount %></td>
                      <td><%= item.bet_result %></td>
                      <td><%= item.create_time %></td>
                  </tr>
              <%
              }) %>
          </tbody>
      </table>
  </div>

  <div><div class="pull-left" id="page-tips"></div>
      <span style="margin-left:20px;">本页累计投注金额：</span><span style="color:#F00"><%= (buyAmount).toFixed(3) %></span>
      <span style="margin-left:20px;">本页累计盈亏金额：</span><span style="color:#F00"><%= (winAmount).toFixed(3) %></span>
      <span style="margin-left:20px;">总共投注金额：</span><span style="color:#F00"><%= (total_bet * 1).toFixed(3) %></span>
      <span style="margin-left:20px;">总共返还金额：</span><span style="color:#F00"><%= (total_win * 1).toFixed(3) %></span>
      <div id="paginator"></div>
  </div>
</section>

<!-- Start: Right Sidebar -->
<aside id="sidebar_right" class="nano">
  <div class="p20 admin-form">

      <h4 class="mt5 text-muted fw500">过滤条件：</h4>

      <hr class="short">

      <hr class="short">
      <h6 class="fw400">用户ID</h6>
      <div class="section mb15">
          <label class="field select">
              <input title="用户ID" type="text" data-field="user_id" id="searchUid" class="gui-input" placeholder="用户ID" value="<%= searched.uid  %>">
              <i class="arrow double"></i>
          </label>
      </div>
      <h6 class="fw400">押注对象</h6>
      <div class="section mb15">
          <label class="field select">
              <select id="searchBetIndex" name="searchBetIndex" data-field="bet_index">
                  <option value="-1" <%= searched.bet_index == -1 ? 'selected' : '' %>>所有</option>
                  <% _.each(METIS_SIX_INDEX, function(v, k){%>
                      <option value="<%= k %>" searched.bet_index == k ? 'selected': 0><%= v %></option>
                  <% }) %>
              </select>
              <i class="arrow double"></i>
          </label>
      </div>
      <hr class="short">
      <h6 class="fw400">开始时间</h6>
      <div class="section row">
          <div class="col-md-6">
                  <input type="text" title="下限，包含当天" name="searchCreatedAtLower" id="searchCreatedAtLower" class="gui-input" data-type="date" value="<%= searched.create_time_lower %>">
                  </label>
              </label>
          </div>
          <div class="col-md-6">
                  <input type="text" title="上限，不包括当天" name="searchCreatedAtUpper" id="searchCreatedAtUpper" class="gui-input" data-type="date" value="<%= searched.create_time_upper %>">
                  </label>
              </label>
          </div>
      </div>

      <button class="btn btn-default btn-block" type="button" id="search">搜索</button>
</aside>
<!-- End: Right Sidebar -->
